import random as r
import numpy

hang=15;lie=15
a=numpy.zeros((hang,lie),dtype='int')
        
i=0     #局部变量
while i<3:
    j=r.randint(0,hang-1)
    k=r.randint(0,lie-1)
    if a[j][k]==0:
        a[j][k]=1
        i+=1
        
xiancun=-numpy.ones((hang,lie),dtype='int')
y=int(input('你猜雷不在第几行'))-1
x=int(input('你猜雷不在第几列'))-1

if a[y][x]==1:
    xiancun[y][x]=10
else:
    i=a[[y-1,y,y+1],:]
    i=i[:,[x-1,x,x+1]]
    i=(numpy.sum(i,axis=0))
    i=(numpy.sum(i))
    xiancun[y][x]=i
    if i==0:
        
    
        

print(a)
print(xiancun)



# def dianji(xiancun,a,x,y):
#     if(x==1):
#         return
#     if(y==1):
#         return
#     if(x==lie):
#         return
#     if(y==hang):
#         return
#     i=a[[y-1,y,y+1],:]
#     i=i[:,[x-1,x,x+1]]
#     i=(numpy.sum(i,axis=0))
#     i=(numpy.sum(i))
#     xiancun[y][x]=i
#     if i==0:
#         dianji(xiancun,a,x-1,y-1)
#         dianji(xiancun,a,x,y-1)
#         dianji(xiancun,a,x+1,y-1)
#         dianji(xiancun,a,x-1,y)
#         dianji(xiancun,a,x+1,y)
#         dianji(xiancun,a,x-1,y+1)
#         dianji(xiancun,a,x,y+1)
#         dianji(xiancun,a,x+1,y+1)
#     else:
#         xiancun[y][x]=i
#     return

